package com.base.service.workflow.entity;

import com.base.core.framework.sql.entity.BaseV1Ext;
import com.gitee.magic.core.json.JsonObject;
import com.gitee.magic.jdbc.persistence.annotation.Entity;
import com.gitee.magic.jdbc.persistence.annotation.Table;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.ColumnDef;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.Indexes;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.IndexesUnion;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.ScriptConverter;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.TableDef;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.indexes.Normal;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.annotations.indexes.UniqueUnion;
import com.gitee.magic.jdbc.persistence.source.jdbc.script.converter.FieldText;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author start 
 */
@Getter
@Setter
@ToString
@Entity("flow")
@Table("wor_flow")
@TableDef(comment = "流程流转", 
indexes = @IndexesUnion(unique = @UniqueUnion(fields = {"processId","finished"})))
public class FlowDO extends BaseV1Ext {

	private static final long serialVersionUID = 1L;

	public FlowDO() {
	}

	@ColumnDef(indexes = @Indexes(normal = @Normal),comment = "流程实例ID")
	private Long processId;

	@ColumnDef(indexes = @Indexes(normal = @Normal),comment = "流程任务ID")
	private Long taskId;

	@ColumnDef(comment = "流转父Id")
	private Long parentId;

	@ColumnDef(comment = "是否完成(0未完成)")
	private Long finished;

	@ScriptConverter(FieldText.class)
	@ColumnDef(comment = "变量")
	private JsonObject variables;

}
